package com.shengqin.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shengqin.common.pojo.CommonPage;
import com.shengqin.entity.PlanStudent;
import com.shengqin.entity.ResultRecord;
import com.shengqin.entity.TestResult;
import com.baomidou.mybatisplus.extension.service.IService;
import com.shengqin.pojo.plan.PlanQueryParam;
import com.shengqin.pojo.plan.result.ImportTestResultParam;
import com.shengqin.pojo.plan.result.ScoreQueryResult;
import com.shengqin.pojo.summary.SummaryModel;
import com.shengqin.pojo.summary.SummaryQueryParam;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * <p>
 * 成绩 服务类
 * </p>
 *
 * @author Rui.Zhou
 * @since 2023-12-11
 */
public interface ITestResultService extends IService<TestResult> {

    Page<TestResult> getPage(CommonPage<TestResult> queryPage);

    void importBatch(List<ImportTestResultParam> cachedDataList, Integer planId,String type);

    List<TestResult> listByPlanParam(PlanQueryParam planQueryParam);

    List<SummaryModel> summary(SummaryQueryParam queryParam);

    List<TestResult> listByPlanIdAndStudyCodes(Integer planId, Collection<String> studyCodes);

    Boolean calculate(TestResult queryParam);

    Boolean clearData(TestResult queryParam);

    void removeByPlanIdAndStudyCodeAndPrjNames(Integer planId, String studyCode, Set<String> prjNames);

    void updateStudentInfo(Integer planId);

    Boolean updateParentPlanTest(TestResult queryParam);

    List<TestResult> listByPlanIdAndPrjNamesAndStudyCode(Integer parentPlanId, Set<String> projectNames, String studyCode);

    List<TestResult> listByPlanId(Integer planId);

    Boolean retry(Long retryId);

    List<TestResult> listByPlanIdAndStudyCode(String studyCode, Integer planId);

    ScoreQueryResult queryScoreResult(ScoreQueryResult scoreQueryResult);

    List<TestResult> buildTestResultList(List<ResultRecord> resultRecords, Map<String, PlanStudent> studentMap);
}
